require("../scss/admin_home.scss")
require("../scss/admin_course_edit.scss")

const createStoreWithMiddleware = require("./common/common").createStoreWithMiddleware
import courseEditApp from "./reducers/admin/course_edit_reducers"

let store = createStoreWithMiddleware(courseEditApp)

import {Provider} from "react-redux"
import { Router, Route, Link , browserHistory,IndexRoute} from 'react-router'

import AdminHeader from "./components/admin/AdminHeader/AdminHeader.jsx"
import AdminSidebar from "./components/admin/AdminSidebar/AdminSidebar.jsx"
import AdminCourseEditContainer from "./containers/admin/CourseEditContainer.jsx"

import CourseInfoEdit from "./components/admin/CourseInfoEdit/CourseInfoEdit.jsx"
import CourseVideoEdit from "./components/admin/CourseVideoEdit/CourseVideoEdit.jsx"
import CourseFilesEditContainer from "./containers/admin/CourseFilesContainer.jsx"
import CourseCommentsEditContainer from "./containers/admin/CourseCommentsEditContainer.jsx"
import CourseNotesEditContainer from "./containers/admin/CourseNotesEditContainer.jsx"

ReactDOM.render(
    <AdminHeader />,
    document.getElementById("AdminHeader")
)

ReactDOM.render(
    <AdminSidebar />,
    document.getElementById("AdminSidebar")
)

ReactDOM.render(
    <Provider store={store}>
        <Router history={browserHistory}>
            <Route path="/admin/course_edit" component={AdminCourseEditContainer}>
                <IndexRoute component={CourseInfoEdit} />
                <Route path="info" component={CourseInfoEdit} />
                <Route path="video" component={CourseVideoEdit} />
                <Route path="files" component={CourseFilesEditContainer} />
                <Route path="comments" component={CourseCommentsEditContainer} />
                <Route path="notes" component={CourseNotesEditContainer} />
            </Route>
        </Router>
    </Provider>
    ,
    document.getElementById("AdminCourseEdit")
)